Add a new hook called 'init_serdes_common' to be able to perform
initialisations or anything else subject to all SerDes. This hook is
called in the end of 'rtpcs_probe' after everything else is done.
This is meant primarily to support the transition of RTL83XX from PHY
driver to PCS driver. Thus, it may be removed later again or kept if
there is sufficient need for this.
Signed-off-by: Jonas Jelonek <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20876
Signed-off-by: Hauke Mehrtens <[email protected]>
int mac_rx_pause_sts;
int mac_tx_pause_sts;
const struct phylink_pcs_ops *pcs_ops;
+ int (*init_serdes_common)(struct rtpcs_ctrl *ctrl);
int (*set_autoneg)(struct rtpcs_ctrl *ctrl, int sds, unsigned int neg_mode);
int (*setup_serdes)(struct rtpcs_ctrl *ctrl, int sds, phy_interface_t mode);
};
ctrl->tx_pol_inv[sds] = of_property_read_bool(child, "realtek,pnswap-tx");
}
+ if (ctrl->cfg->init_serdes_common) {
+ ret = ctrl->cfg->init_serdes_common(ctrl);
+ if (ret)
+ return ret;
+ }
+
/*
* rtpcs_create() relies on that fact that data is attached to the platform device to
* determine if the driver is ready. Do this after everything is initialized properly.